'''
Created on 2011/09/02

@author: Administrator
'''
from main import PlayGame
from nose.tools import ok_, eq_
from google.appengine.api import memcache

class TestPlayGame:

#def getTest():
           
    def checkPlayedTest(self):
        nickname="testJoe"
        memcache.add('player',nickname,30)
        nickname2="testJohn"
        playGame= PlayGame()
        ok_(playGame.checkPlayed(nickname))     
        eq_(playGame.checkPlayed(nickname2),False)
    
    def setDayPlayLimitation_test(self):
        playGame = PlayGame()
        nickname="testJoe"
        playGame.setDayPlayLimitation(nickname)
        eq_(memcache.get('player'),not None)
        
    def getURLs_test(self):
        playGame = PlayGame()
        conf = playGame.getURLs("urlSettings.ini")
        eq_(conf.get('pc','cssURL'),'http://thedestinytoday.appspot.com/html/pc.css')
    
#    def getUserInfoTest(self):
#        playGame = PlayGame()
        
    def createSessionID_test(self):
        playGame = PlayGame()
        sessionID=playGame.createSessionID()
        eq_(len(sessionID),8)
        
        

#    def postTest():
    
#    def setQuestionTest():
    
#    def storeAnswerTest():
    
#    def getURLConfigurationTest():

#    def retrieveQuestionTest():
    
#    def finalizeGameTest():
    
#    def checkAnswersTest():
    
#    def checkLevelTest():
    


if __name__ == '__main__':
    import nose
    nose.main()
    
    